﻿
Partial Class shopListOut
    Inherits System.Web.UI.Page
    Public result As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        '--取回沒有聯絡過的客戶資料，要管制，用日期+目前小時當成PW EX:201101220100
        result = String.Empty
        Dim pw, uid, sDate, eDate As String
        pw = Request.QueryString("pw") + String.Empty
        sDate = Request.QueryString("sdate") + String.Empty
        eDate = Request.QueryString("edate") + String.Empty
        If (Utility.GetDateTimePW(pw)) Then
            uid = Request.QueryString("uid")
            getData(uid, sDate, eDate)
        End If
    End Sub

    Protected Sub getData(ByVal p_id As String, ByVal p_sdate As String _
                          , ByVal p_edate As String)
        Dim dt As System.Data.DataTable
        Try
            dt = Utility.GetShopingList(p_sdate, p_edate)
            gv1.DataSource = dt
            If (dt.Rows.Count > 0) And (String.Empty.Equals(p_sdate)) _
                And (String.Empty.Equals(p_edate)) And (Not String.Empty.Equals(p_id)) Then
                Utility.Updshopcar(p_id)
                'result =  "ok"           
            End If
            result = IIf(dt.Rows.Count.Equals(0), "NO DATA", "ok")
            gv1.DataBind()

        Catch ex As Exception
            result = String.Format("error:{0}", ex.Message)
        End Try
    End Sub
End Class
